cmake_minimum_required(VERSION 3.0.2)

set(CMAKE_CXX_STANDARD 17)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

project(myClock)

find_package(Dtk COMPONENTS Widget REQUIRED)

set(QtFindModules Core Gui Widgets Charts Multimedia Concurrent)
foreach(QtModule ${QtFindModules})
    find_package(Qt5 COMPONENTS ${QtModule} REQUIRED)
    # include qt module private include directors
    include_directories(${Qt5${QtModule}_PRIVATE_INCLUDE_DIRS})
    # can use target_link_libraries(xxx ${QtUseModules})
    list(APPEND QtUseModules "Qt5::${QtModule}")
    message("QtModule found ${QtModule} OK!")
endforeach()

set(CXX_CPP
    widgets/dashboard.cpp
    widgets/displayframe.cpp
    widgets/progressbarwidget.cpp
    widgets/tomatowidget.cpp
    widgets/whitenoiseplayer.cpp
    widgets/whitenoise.cpp
    widgets/chartwidget.cpp
    demo.cpp
    eventreceiver.cpp
    manage/clockmanage.cpp
    demo.json
    )

set(CXX_H
    widgets/displayframe.h
    widgets/whitenoiseplayer.h
    widgets/whitenoise.h
    widgets/dashboard.h
    widgets/progressbarwidget.h
    widgets/tomatowidget.h
    widgets/chartwidget.h
    demo.h
    eventreceiver.h
    manage/clockmanage.h
    )

add_library(${PROJECT_NAME}
    SHARED
    ${CXX_H}
    ${CXX_CPP}
    demo.qrc
    )

target_link_libraries(${PROJECT_NAME}
    duc-framework
    duc-base
    duc-common
    duc-services
    ${QtUseModules}
    ${PkgUserModules}
    ${DtkWidget_LIBRARIES}
    )


if(NOT PLUGIN_INSTALL_PATH)
    set(PLUGIN_INSTALL_PATH "/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/deepin-unioncode/plugins")
endif()

install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${PLUGIN_INSTALL_PATH})


